﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ymatou.ServiceCenter.Common;

namespace Ymatou.ServiceCenter.Domain.Models
{
    public class RpcClientConfig
    {
        public static readonly RpcClientConfig DefaultRpcClientConfig = new RpcClientConfig
        {
            AppId = "Default",
            UpdateMetadataDelaySecond = "AutoUpdateServiceMetadataDelaySecond".GetAppSettingsValue<int>(180),
            EnableUseRpcCall = "EnableUseRpcCall".GetAppSettingsValue<bool>(true),
            EnableSendNullData = "EnableSendNullData".GetAppSettingsValue<bool>(false),
            //RpcServiceHost = "http://rpc.iapi.ymatou.com",
            SendDataDelayMinute = "SendDataDelayMinute".GetAppSettingsValue<int>(30),
            HttpRequestTimeOut = "DefaultTimeOut".GetAppSettingsValue<int>(60000)
        };

        public string AppId { get; set; }
        public bool EnableUseRpcCall { get; set; }
        public bool EnableSendNullData { get; set; }
      
        //public string RpcServiceHost { get; set; }
        public int SendDataDelayMinute { get; set; }
        public int UpdateMetadataDelaySecond { get; set; }

        /// <summary>
        /// Http请求执行的超时时间（单位：毫秒 )
        /// </summary>
        public int HttpRequestTimeOut { get; set; }
        public DateTime? CreateTime { get; set; }
        public DateTime? LastUpdateTime { get; set; }
    }
}
